<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 内部样式表style -->
    <style>
        .title{
            color: red;
        }
    </style>
</head>
<body>
    <!-- 
        HTML--网页的基本内容，人的架构
        CSS--网页的样式，人的皮肤外观
        JS--网页的行为，人的动作--类似于手动点击、拖拽等
    -->
    <h1 class="title">标题</h1>
    <script>
        var h1_demo = document.getElementsByClassName('title')[0]
        h1_demo.onclick = function(){
            alert('giao')
        }
    </script>
</body>
</html>